home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / lib_test / test_boolean.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  1.1 KB  |  62 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_BOOLEAN
  5.  
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    make is
  12.       local
  13.      tr, fr: BOOLEAN_REF;
  14.       do
  15.      is_true(true);
  16.      is_true(not false);
  17.      is_true(true = true);
  18.      is_true(false = false);
  19.      is_true(true = not false);
  20.      is_true(equal(true,true));
  21.      
  22.      tr := true;
  23.      fr := false;
  24.      check
  25.         not equal(tr,fr);
  26.         not equal(true,false);
  27.      end;
  28.      is_true(not equal(true,false));
  29.      is_true(equal(false,false));
  30.      
  31.      is_true(false xor true);
  32.      is_true(true xor false);
  33.      
  34.      is_true(false implies true);
  35.      is_true(false implies never_call);
  36.      is_true(never_call_flag = 0);
  37.       end;
  38.    
  39.    never_call: BOOLEAN is
  40.       do
  41.      never_call_flag := never_call_flag + 1;
  42.       end;
  43.    
  44.    never_call_flag: INTEGER;
  45.  
  46.    
  47.    is_true(b: BOOLEAN) is
  48.       do
  49.      cpt := cpt + 1;
  50.      if not b then
  51.         std_output.put_string("TEST_BOOLEAN: ERROR Test # ");
  52.         std_output.put_integer(cpt);
  53.         std_output.put_string("%N");
  54.      else
  55.         --std_output.put_string("Yes%N");
  56.      end;
  57.       end;
  58.    
  59.    cpt: INTEGER;
  60.    
  61. end -- TEST_BOOLEAN
  62.